package com.shg.admin.exception;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

/**
 * @DESCRIPTION: 全局异常处理
 * @USER: shg
 * @DATE: 2023/11/28 22:07
 */
@Slf4j
@ControllerAdvice
public class GlobalExceptionHandler {
    
    @ExceptionHandler(value = {ArithmeticException.class,NullPointerException.class})
    public String handlerException(Exception e){
      log.error("异常信息是：{}",e);
      return "login";
    }
}
